from django.contrib import admin

# Register your models here.
from .models import User,AddressBook

# 设置header
admin.site.site_header = '管理后台系统'
# 设置title
admin.site.site_title = '管理后台系统'

class UserAdmin(admin.ModelAdmin):
    #设置列表可显示的字段
    list_display = ['id','name','phone','status','create_time','update_time']
    #设置可编辑字段
    list_editable = ('status',)
    #设置过滤选项
    list_filter = ('status',)
    #设置搜索选项
    search_fields = ('name','phone')
    #按更新日期排序
    ordering = ('-update_time',)
    #每页显示条目数
    list_per_page = 20


admin.site.register(User,UserAdmin)
admin.site.register(AddressBook)
